

<!DOCTYPE html>
<html lang="zh-CN" color-mode=light>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>【Docker】win10 环境下安装 Docker - Xiaozhou`s Blog-小州的个人博客</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="google" content="notranslate" />
  <meta name="keywords" content="Blog,Java,Spring,SpringBoot,SSM,Linux">
  <meta name="description" content="Docker 是一个开源的应用容器引擎，基于 Go 语...">
  <meta name="author" content="xiaozhou">
  <link rel="icon" href="/images/icons/favicon-16x16.png" type="image/png" sizes="16x16">
  <link rel="icon" href="/images/icons/favicon-32x32.png" type="image/png" sizes="32x32">
  <link rel="apple-touch-icon" href="/images/icons/apple-touch-icon.png" sizes="180x180">
  <meta rel="mask-icon" href="/images/icons/stun-logo.svg" color="#333333">
  
    <meta rel="msapplication-TileImage" content="/images/icons/favicon-144x144.png">
    <meta rel="msapplication-TileColor" content="#000000">
  

  
<link rel="stylesheet" href="/css/style.css">


  
    
<link rel="stylesheet" href="//at.alicdn.com/t/font_1445822_s6x2xcokxrl.css">

  

  
    
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css">

  

  
    
      
        
        
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/xcode.min.css" name="highlight-style" mode="light">

      
        
        
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/solarized-dark.min.css" name="highlight-style" mode="dark">

      
  

  <script>
    var CONFIG = window.CONFIG || {};
    var ZHAOO = window.ZHAOO || {};
    CONFIG = {
      isHome: false,
      fancybox: true,
      pjax: false,
      lazyload: {
        enable: true,
        only_post: 'false',
        loading: 'https://gitee.com/xiaozhoujun/personal-drawing-bed/raw/master/loading.gif'
      },
      donate: {
        enable: true,
        alipay: '/images/theme/alipay.jpg',
        wechat: '/images/theme/wechat.jpg'
      },
      galleries: {
        enable: true
      },
      fab: {
        enable: true,
        always_show: false
      },
      carrier: {
        enable: true
      },
      daovoice: {
        enable: false
      },
      preview: {
        background: {
          default: '/images/theme/welcome-image.jpg',
          api: 'https://api.ixiaowai.cn/gqapi/gqapi.php'
        },
        motto: {
          default: '我在开了灯的床头下，想问问自己的心啊。',
          api: 'https://v2.jinrishici.com/one.json',
          data_contents: '["data","content"]'
        },
      },
      qrcode: {
        enable: false,
        type: 'url',
        image: 'https://pic.izhaoo.com/weapp-code.jpg',
      },
      toc: {
        enable: true
      },
      scrollbar: {
        type: 'simple'
      },
      notification: {
        enable: false,
        delay: 4500,
        list: '',
        page_white_list: '',
        page_black_list: ''
      }
    }
  </script>

  

  

<meta name="generator" content="Hexo 5.3.0"></head>

<body class="lock-screen">
  <div class="loading"></div>
  


  <nav class="navbar">
    <div class="left">
      
      
        <i class="iconfont iconmoono" id="color-toggle" color-toggle="light"></i>
      
    </div>
    <div class="center">【Docker】win10 环境下安装 Docker</div>
    <div class="right">
      <i class="iconfont iconmenu j-navbar-menu"></i>
    </div>
    
  </nav>

  

<nav class="menu">
  <div class="menu-wrap">
    <div class="menu-close">
      <i class="iconfont iconbaseline-close-px"></i>
    </div>
    <ul class="menu-content"><li class="menu-item">
        <a href="/ " class="underline "> 首页</a>
      </li><li class="menu-item">
        <a href="/archives/ " class="underline "> 归档</a>
      </li><li class="menu-item">
        <a href="/galleries/ " class="underline "> 相册</a>
      </li><li class="menu-item">
        <a href="/tags/ " class="underline "> 标签</a>
      </li><li class="menu-item">
        <a href="/categories/ " class="underline "> 分类</a>
      </li><li class="menu-item">
        <a href="/friends/ " class="underline "> 友链</a>
      </li><li class="menu-item">
        <a href="/about/ " class="underline "> 关于</a>
      </li></ul>
    
      <div class="menu-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
    
  </div>
</nav>
  <main id="main">
  <div class="article-wrap">
    <div class="row container">
      <div class="col-xl-3"></div>
      <div class="col-xl-6"><article class="article">
  <div class="wrap">
    <section class="head">
  <img   class="lazyload" data-original="/images/post/cover-01.jpg" src=""  draggable="false">
  <div class="head-mask">
    <h1 class="head-title">【Docker】win10 环境下安装 Docker</h1>
    <div class="head-info">
      <span class="post-info-item"><i class="iconfont iconcalendar"></i>二月 02, 2021</span>
      
      <span class="post-info-item"><i class="iconfont iconfont-size"></i>1709</span>
    </div>
  </div>
</section>
    <section class="main">
      <section class="content">
        <h2 id="一、进入-Docker-官网"><a href="#一、进入-Docker-官网" class="headerlink" title="一、进入 Docker 官网"></a>一、进入 Docker 官网</h2><p>首先先到 Docker 官网下载最新官方 Docker for Windows：</p>
<p><a target="_blank" rel="noopener" href="https://docs.docker.com/docker-for-windows/release-notes/">Docker下载页面</a>    </p>
<p><a target="_blank" rel="noopener" href="https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe">Docker Desktop Community 3.1.0 直接下载</a>  </p>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/835c2c9ecb2a7b8468703cf9dbb2bed9334a2798.jpg@1e_1c.webp" src="" ></p>
<p>在官网内可以查看到 Docker 的开发文档。  </p>
<p>根据官网提示，Windows 环境下下载 Docker 必须满足：Docker for Windows requires 64bit Windows 10 Pro and Microsoft Hyper-V（即需要 64 位 Windows 10 Pro(专业版和企业版都可以) 和 Microsoft Hyper-V），Hyper-V 是微软的虚拟机，在 win10 上是自带的，我们只需要启动就可以了。</p>
<h2 id="二、启动-Microsoft-Hyper-V"><a href="#二、启动-Microsoft-Hyper-V" class="headerlink" title="二、启动 Microsoft Hyper-V"></a>二、启动 Microsoft Hyper-V</h2><p>在电脑上打开 “设置”-&gt;“应用和功能”-&gt;“可选功能”-&gt; “更多 Windows 功能”。<br> <img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/4a586a1da106bcba157ef739cc921d48c115dd85.jpg@1e_1c.webp" src="" ><br>  如下，勾选 Hyper-V 选项： </p>
<p> <img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/57839ad2a1b939d35a739a1b425c2327dd618308.jpg@1e_1c.webp" src="" ></p>
<h2 id="三、安装-Docker"><a href="#三、安装-Docker" class="headerlink" title="三、安装 Docker"></a>三、安装 Docker</h2><p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/835c2c9ecb2a7b8468703cf9dbb2bed9334a2798.jpg@1e_1c.webp" src="" ></p>
<p>点击运行下一步下一步</p>
<h2 id="四、开始-Docker-之旅"><a href="#四、开始-Docker-之旅" class="headerlink" title="四、开始 Docker 之旅"></a>四、开始 Docker 之旅</h2><h4 id="配置阿里云镜像加速器"><a href="#配置阿里云镜像加速器" class="headerlink" title="#配置阿里云镜像加速器"></a>#配置阿里云镜像加速器</h4><p><a target="_blank" rel="noopener" href="https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors">https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors</a></p>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/a60fd3ea6fa2953d700320f92cce6d725a96d0f8.png@1e_1c.webp" src="" ></p>
<p>配置图如下</p>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/e2bd958d5f760ac0bb68ce1120df724a1216a67c.png@1e_1c.webp" src="" ></p>
<h4 id="启动Docker"><a href="#启动Docker" class="headerlink" title="#启动Docker"></a>#启动Docker</h4><figure class="highlight apache"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">docker</span> run -d -p <span class="hljs-number">80</span>:<span class="hljs-number">80</span> docker/getting-started<br></code></pre></td></tr></table></figure>
<h4 id="校验Docker"><a href="#校验Docker" class="headerlink" title="#校验Docker"></a>#校验Docker</h4><figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs routeros">docker <span class="hljs-builtin-name">run</span> hello-world <br></code></pre></td></tr></table></figure>


<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/5f0ab6a26a1899e72feff0f0a31da27f152c99b8.jpg@1e_1c.webp" src="" ></p>
<h2 id="五、Kubernetes"><a href="#五、Kubernetes" class="headerlink" title="五、Kubernetes"></a>五、Kubernetes</h2><p>为<strong>Docker Desktop for Mac/Windows</strong>开启<strong>Kubernetes</strong>和<strong>Istio - Enable Kubernetes/Istio on Docker Desktop in China</strong></p>
<p><a target="_blank" rel="noopener" href="https://github.com/AliyunContainerService/k8s-for-docker-desktop">阿里云 k8s-for-docker-desktop</a></p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">git clone https:<span class="hljs-regexp">//gi</span>thub.com<span class="hljs-regexp">/AliyunContainerService/</span>k8s-<span class="hljs-keyword">for</span>-docker-desktop.git<br></code></pre></td></tr></table></figure>


<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/5aa3bf4e3b7c301c896a165b75c832a566bbb075.jpg@1e_1c.webp" src="" ></p>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/d7e088a03fcc57287fe18ca48122e1769de5f564.jpg@1e_1c.webp" src="" ></p>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/568f6b5ee0cba436bf67ac6d078a93414e288889.jpg@1e_1c.webp" src="" ></p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs nginx"><span class="hljs-attribute">kubectl</span> cluster-<span class="hljs-literal">info</span><br></code></pre></td></tr></table></figure>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/bb1535af998bf7c70f573a60f1892d2870ff69c9.jpg@1e_1c.webp" src="" ></p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs routeros">kubectl <span class="hljs-builtin-name">get</span> nodes<br></code></pre></td></tr></table></figure>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/e16c98f69b98b3c21b8263f71d9b98ee27c58f4a.jpg@1e_1c.webp" src="" ></p>
<figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs livecodeserver">kubectl <span class="hljs-built_in">get</span> pods -n kube-<span class="hljs-keyword">system</span><br></code></pre></td></tr></table></figure>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/5cca000108419175fb9d097deb837f73123591ec.jpg@1e_1c.webp" src="" ></p>
<h4 id="部署-Kubernetes-dashboard"><a href="#部署-Kubernetes-dashboard" class="headerlink" title="部署 Kubernetes dashboard"></a>部署 Kubernetes dashboard</h4><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">kubectl apply -f https:<span class="hljs-regexp">//</span>raw.githubusercontent.com<span class="hljs-regexp">/kubernetes/</span>dashboard<span class="hljs-regexp">/v2.0.4/</span>aio<span class="hljs-regexp">/deploy/</span>recommended.yaml<br></code></pre></td></tr></table></figure>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/f2e12cbec0d5692ea0062a7ec8c80c6dd3f9c537.jpg@1e_1c.webp" src="" ></p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs routeros">kubectl <span class="hljs-builtin-name">get</span> ns<br></code></pre></td></tr></table></figure>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/0b3c881b9a858f6a5db53f9003014c1cee3ff918.jpg@1e_1c.webp" src="" ></p>
<p>开启 API Server 访问代理</p>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs ebnf"><span class="hljs-attribute">kubectl proxy</span><br></code></pre></td></tr></table></figure>
<p>通过如下 URL 访问 Kubernetes dashboard</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">http:<span class="hljs-regexp">//</span>localhost:<span class="hljs-number">8001</span><span class="hljs-regexp">/api/</span>v1<span class="hljs-regexp">/namespaces/</span>kubernetes-dashboard<span class="hljs-regexp">/services/</span>https:kubernetes-dashboard:<span class="hljs-regexp">/proxy/</span><br></code></pre></td></tr></table></figure>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/7111dc368565726e94cffd1ae6d11ad5d8d9a4ea.jpg@1e_1c.webp" src="" ></p>
<h4 id="配置控制台访问令牌"><a href="#配置控制台访问令牌" class="headerlink" title="配置控制台访问令牌"></a>配置控制台访问令牌</h4><p>对于Windows环境</p>
<figure class="highlight dsconfig"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs dsconfig">$<span class="hljs-string">TOKEN</span>=((<span class="hljs-string">kubectl</span> -<span class="hljs-string">n</span> <span class="hljs-string">kube-system</span> <span class="hljs-string">describe</span> <span class="hljs-string">secret</span> <span class="hljs-string">default</span> | <span class="hljs-string">Select-String</span> <span class="hljs-string">&quot;token:&quot;</span>) -<span class="hljs-string">split</span> <span class="hljs-string">&quot; +&quot;</span>)[<span class="hljs-string">1</span>]<br><span class="hljs-string">kubectl</span> <span class="hljs-string">config</span> <span class="hljs-built_in">set-credentials</span> <span class="hljs-string">docker-for-desktop</span> <span class="hljs-built_in">--token=&quot;$&#123;TOKEN&#125;&quot;</span><br><span class="hljs-built_in">echo</span> $<span class="hljs-string">TOKEN</span><br></code></pre></td></tr></table></figure>


<p>填入令牌后登录</p>
<p><img   class="lazyload" data-original="https://i0.hdslb.com/bfs/album/7aecdc030e2c0f6a4cf37e38ac68382bca805abe.jpg@1e_1c.webp" src="" ></p>
      </section>
      <section class="extra">
        
        
          <section class="donate">
  <div id="qrcode-donate">
    <img   class="lazyload" data-original="/images/theme/alipay.jpg" src="" >
  </div>
  <div class="icon">
    <a href="javascript:;" id="alipay"><i class="iconfont iconalipay"></i></a>
    <a href="javascript:;" id="wechat"><i class="iconfont iconwechat-fill"></i></a>
  </div>
</section>
        
        
  <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Docker/" rel="tag">Docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%AE%B9%E5%99%A8/" rel="tag">容器</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%99%9A%E6%8B%9F%E6%9C%BA/" rel="tag">虚拟机</a></li></ul> 

        
  <nav class="nav">
    <a></a>
    <a href="/2021/01/26/%E5%9C%A8%20Hexo%20%E5%8D%9A%E5%AE%A2%E4%B8%8A%E6%B7%BB%E5%8A%A0%E5%8F%AF%E7%88%B1%E7%9A%84%20Live%202D%20%E6%A8%A1%E5%9E%8B/">在 Hexo 博客上添加可爱的 Live 2D 模型<i class="iconfont iconright"></i></a>
  </nav>

      </section>
      
        <section class="comments">
  
  
<div id="valine"></div>
<script defer src="//unpkg.com/valine/dist/Valine.min.js"></script>
<script>
  window.onload = function () {
    var loadValine = function () {
      new Valine({
        el: '#valine',
        app_id: "DT7lf4wjyGz3dzFvkNWkjDjw-gzGzoHsz",
        app_key: "0BFENrKLIvytrnTsCPNxF5tP",
        placeholder: "雁过留痕",
        avatar: "mp",
        pageSize: "10",
        lang: "zh-CN",
      });
    }
    if ( false ) {
      $("#comments-btn").on("click", function () {
        $(this).hide();
        loadValine();
      });
    } else {
      loadValine();
    }
  };
</script>

</section>
      
    </section>
  </div>
</article></div>
      <div class="col-xl-3">
        
          
  <aside class="toc-wrap">
    <h3 class="toc-title">文章目录：</h3>
    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E8%BF%9B%E5%85%A5-Docker-%E5%AE%98%E7%BD%91"><span class="toc-text">一、进入 Docker 官网</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E5%90%AF%E5%8A%A8-Microsoft-Hyper-V"><span class="toc-text">二、启动 Microsoft Hyper-V</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E5%AE%89%E8%A3%85-Docker"><span class="toc-text">三、安装 Docker</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%9B%E3%80%81%E5%BC%80%E5%A7%8B-Docker-%E4%B9%8B%E6%97%85"><span class="toc-text">四、开始 Docker 之旅</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%94%E3%80%81Kubernetes"><span class="toc-text">五、Kubernetes</span></a></li></ol>
  </aside>

        
      </div>
    </div>
  </div>
</main>
  

<footer class="footer">
  <div class="footer-social"><a 
        href="tencent://message/?Menu=yes&uin=574385240 "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#DA2E76'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconQQ "></i>
      </a><a 
        href="javascript:; "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#09BB07'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconwechat-fill "></i>
      </a><a 
        href="https://www.instagram.com/ "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#DA2E76'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconinstagram "></i>
      </a><a 
        href="https://github.com/xiaozhoujun "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#9f7be1'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  icongithub-fill "></i>
      </a><a 
        href="mailto:xiaozhou1650@gmail.com "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#DA2E76'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconmail "></i>
      </a></div>
  
    <div class="footer-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
  
</footer>
  
      <div class="fab fab-plus">
    <i class="iconfont iconplus"></i>
  </div>
  
  
  <div class="fab fab-up">
    <i class="iconfont iconcaret-up"></i>
  </div>
  
  
    <div class="scrollbar j-scrollbar">
  <div class="scrollbar-current j-scrollbar-current"></div>
</div>
  
  
    
<script src="/js/color-mode.js"></script>

  
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/assets/shizuku.model.json"},"display":{"position":"Left","width":150,"height":300},"mobile":{"show":true},"log":false});</script></body>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>



  
<script src="https://cdn.bootcdn.net/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>




  
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>








<script src="/js/utils.js"></script>
<script src="/js/script.js"></script>







  <script>
    (function () {
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
      } else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
      }
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>













</html>